package twentytwenty;

/**
 * @Author: Zahi
 * @Description:
 * @Date Created in 2020-12-07 10:35
 * @Modified By:
 */
public class ReverseBits_190 {
    public static void main(String [] args){
        System.out.println(reverseBits(456));
    }

    public static int reverseBits(int n) {
        int res = 0;
        for (int i = 0; i < 32; i++) {
            res = (res << 1) | (n & 1);
            n >>= 1;
        }
        return res;
    }
}
